#include <iostream>
using namespace std;

class A {
public:
	A (int data = 0) {
		cout << "A::A(int data)" << endl;
		m_data = data;
	}
	A (const A& that) {
		cout << "A::A(const A& that)" << endl;
		m_data = that.m_data;
	}
	int m_data;
};

class B {
public:
	A m_a; //类 类型的成员变量
};

int main (void)
{
	B b;
	b.m_a.m_data = 1234;
	B b2(b);
	cout << b.m_a.m_data << endl;//1234
	cout << b2.m_a.m_data << endl;//1234

	return 0;
}
